<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>emacps: xemacps_example_util.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">emacps
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xemacps__example__util_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xemacps_example_util.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file implements the utility functions for the XEmacPs example code. </p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
</p>
<hr/>
<p>
1.00a wsy  01/10/10 First release
1.00a asa  01/24/12 A new version of EmacPsUtilEnterLoopback is used for
                      Zynq boards. Now there are two versions of
                      EmacPsUtilEnterLoopback, one for PEEP and one for Zynq.
                      If the example is to be run  on a PEEP board, define PEEP
                      in <a class="el" href="xemacps__example_8h.html" title="Defines common data types, prototypes, and includes the proper headers for use with the EMACPS exampl...">xemacps_example.h</a>.
1.01a asa  02/27/12 The sleep value after PHY loopback is setup is reduced
              for Zynq.
3.0   kpc  01/23/15 Removed PEEP board related code
3.2     hk   09/30/15 Added support for TI PHY DP83867
3.2   mus  02/20/16 Added support for microblaze.
3.9   hk   02/12/19 Use selected speed in loopback mode.
3.14  sk   12/23/20 Correct variable name to delay in <a class="el" href="xemacps__example_8h.html#a907ad3930dc1eefe5a53a0b82b715091" title="This function provides delays in seconds. ">EmacpsDelay()</a> function
                      to fix the doxygen warning.
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a67af5d890c407455dc295833390d924a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__example__util_8c.html#a67af5d890c407455dc295833390d924a">PHY_DETECT_REG1</a>&#160;&#160;&#160;2</td></tr>
<tr class="memdesc:a67af5d890c407455dc295833390d924a"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function detects the PHY address by looking for successful MII status register contents.  <a href="#a67af5d890c407455dc295833390d924a">More...</a><br/></td></tr>
<tr class="separator:a67af5d890c407455dc295833390d924a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e2b911e85d350111126a1ed5dd62c7b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__example__util_8c.html#a1e2b911e85d350111126a1ed5dd62c7b">PHY_REG0_RESET</a>&#160;&#160;&#160;0x8000</td></tr>
<tr class="memdesc:a1e2b911e85d350111126a1ed5dd62c7b"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sets the PHY to loopback mode.  <a href="#a1e2b911e85d350111126a1ed5dd62c7b">More...</a><br/></td></tr>
<tr class="separator:a1e2b911e85d350111126a1ed5dd62c7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a0bc7c575f2858a89f9496f83dc6052d4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__example__util_8c.html#a0bc7c575f2858a89f9496f83dc6052d4">EmacPsUtilFrameHdrFormatMAC</a> (EthernetFrame *FramePtr, char *DestAddr)</td></tr>
<tr class="memdesc:a0bc7c575f2858a89f9496f83dc6052d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the MAC addresses in the frame.  <a href="#a0bc7c575f2858a89f9496f83dc6052d4">More...</a><br/></td></tr>
<tr class="separator:a0bc7c575f2858a89f9496f83dc6052d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6fddc02339ce2adea5260e2401572eb8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__example__util_8c.html#a6fddc02339ce2adea5260e2401572eb8">EmacPsUtilFrameHdrFormatType</a> (EthernetFrame *FramePtr, u16 FrameType)</td></tr>
<tr class="memdesc:a6fddc02339ce2adea5260e2401572eb8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the frame type for the specified frame.  <a href="#a6fddc02339ce2adea5260e2401572eb8">More...</a><br/></td></tr>
<tr class="separator:a6fddc02339ce2adea5260e2401572eb8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a745c2dd310df9fc6a3067ec7c426d9b5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__example__util_8c.html#a745c2dd310df9fc6a3067ec7c426d9b5">EmacPsUtilFrameSetPayloadData</a> (EthernetFrame *FramePtr, u32 PayloadSize)</td></tr>
<tr class="memdesc:a745c2dd310df9fc6a3067ec7c426d9b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function places a pattern in the payload section of a frame.  <a href="#a745c2dd310df9fc6a3067ec7c426d9b5">More...</a><br/></td></tr>
<tr class="separator:a745c2dd310df9fc6a3067ec7c426d9b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9bf345bfd8b6008fd32c436c1c8f049e"><td class="memItemLeft" align="right" valign="top">LONG&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__example__util_8c.html#a9bf345bfd8b6008fd32c436c1c8f049e">EmacPsUtilFrameVerify</a> (EthernetFrame *CheckFrame, EthernetFrame *ActualFrame)</td></tr>
<tr class="memdesc:a9bf345bfd8b6008fd32c436c1c8f049e"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function verifies the frame data against a CheckFrame.  <a href="#a9bf345bfd8b6008fd32c436c1c8f049e">More...</a><br/></td></tr>
<tr class="separator:a9bf345bfd8b6008fd32c436c1c8f049e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af60ff561f93957fc82d6625103a3ec5c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__example__util_8c.html#af60ff561f93957fc82d6625103a3ec5c">EmacPsUtilFrameMemClear</a> (EthernetFrame *FramePtr)</td></tr>
<tr class="memdesc:af60ff561f93957fc82d6625103a3ec5c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sets all bytes of a frame to 0.  <a href="#af60ff561f93957fc82d6625103a3ec5c">More...</a><br/></td></tr>
<tr class="separator:af60ff561f93957fc82d6625103a3ec5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a115c0926c08893ef3e71c68f7622576a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__example__util_8c.html#a115c0926c08893ef3e71c68f7622576a">EmacPsUtilstrncpy</a> (char *Destination, const char *Source, u32 n)</td></tr>
<tr class="memdesc:a115c0926c08893ef3e71c68f7622576a"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function copies data from source to desitnation for n bytes.  <a href="#a115c0926c08893ef3e71c68f7622576a">More...</a><br/></td></tr>
<tr class="separator:a115c0926c08893ef3e71c68f7622576a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aca39e6c6bf9a344d743f808eab6031e1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__example__util_8c.html#aca39e6c6bf9a344d743f808eab6031e1">EmacPsUtilEnterLocalLoopback</a> (<a class="el" href="group__emacps.html#ga7510da8ed2cb292c5abdbcc18cc26c67">XEmacPs</a> *EmacPsInstancePtr)</td></tr>
<tr class="memdesc:aca39e6c6bf9a344d743f808eab6031e1"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sets the emacps to loopback mode.  <a href="#aca39e6c6bf9a344d743f808eab6031e1">More...</a><br/></td></tr>
<tr class="separator:aca39e6c6bf9a344d743f808eab6031e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a907ad3930dc1eefe5a53a0b82b715091"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__example__util_8c.html#a907ad3930dc1eefe5a53a0b82b715091">EmacpsDelay</a> (u32 delay)</td></tr>
<tr class="memdesc:a907ad3930dc1eefe5a53a0b82b715091"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function provides delays in seconds.  <a href="#a907ad3930dc1eefe5a53a0b82b715091">More...</a><br/></td></tr>
<tr class="separator:a907ad3930dc1eefe5a53a0b82b715091"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a776b1bc0336021ef0b3542c13ba81e83"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__example__util_8c.html#a776b1bc0336021ef0b3542c13ba81e83">EmacPsUtilErrorTrap</a> (const char *Message)</td></tr>
<tr class="memdesc:a776b1bc0336021ef0b3542c13ba81e83"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is called by example code when an error is detected.  <a href="#a776b1bc0336021ef0b3542c13ba81e83">More...</a><br/></td></tr>
<tr class="separator:a776b1bc0336021ef0b3542c13ba81e83"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a67af5d890c407455dc295833390d924a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PHY_DETECT_REG1&#160;&#160;&#160;2</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function detects the PHY address by looking for successful MII status register contents. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">The</td><td>XEMACPS driver instance</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The address of the PHY (defaults to 32 if none detected)</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a class="anchor" id="a1e2b911e85d350111126a1ed5dd62c7b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PHY_REG0_RESET&#160;&#160;&#160;0x8000</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sets the PHY to loopback mode. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">The</td><td>XEMACPS driver instance </td></tr>
    <tr><td class="paramname">Speed</td><td>is the loopback speed 10/100 Mbit.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful, else XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a907ad3930dc1eefe5a53a0b82b715091"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void EmacpsDelay </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>delay</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function provides delays in seconds. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">delay</td><td>in seconds</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>for microblaze the delay is not accurate and it need to tuned. </dd></dl>

<p>Referenced by <a class="el" href="xemacps__example__intr__dma_8c.html#ac35b45a86a3d585e723b7a2f0bc8b9a2">EmacPsDmaIntrExample()</a>.</p>

</div>
</div>
<a class="anchor" id="aca39e6c6bf9a344d743f808eab6031e1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void EmacPsUtilEnterLocalLoopback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__emacps.html#ga7510da8ed2cb292c5abdbcc18cc26c67">XEmacPs</a> *&#160;</td>
          <td class="paramname"><em>EmacPsInstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sets the emacps to loopback mode. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">EmacPsInstancePtr</td><td>is the XEmacPs driver instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_emac_ps___config.html#a96d8fef7452fcad2bb1831e39751bb96">XEmacPs_Config::BaseAddress</a>, <a class="el" href="group__emacps.html#gac6ed8a7756b8c6fe866807974f93708d">XEMACPS_NWCTRL_LOOPEN_MASK</a>, <a class="el" href="group__emacps.html#gae9bc110a6c627eb231938ebd4d89fecc">XEMACPS_NWCTRL_OFFSET</a>, <a class="el" href="group__emacps.html#ga81a4d6db864dea35b8ddd690f7615539">XEmacPs_ReadReg</a>, and <a class="el" href="group__emacps.html#ga372948c9677f6859b62e87504fb2460e">XEmacPs_WriteReg</a>.</p>

</div>
</div>
<a class="anchor" id="a776b1bc0336021ef0b3542c13ba81e83"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void EmacPsUtilErrorTrap </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>Message</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is called by example code when an error is detected. </p>
<p>It can be set as a breakpoint with a debugger or it can be used to print out the given message if there is a UART or STDIO device.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Message</td><td>is the text explaining the error</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p>Referenced by <a class="el" href="xemacps__example__intr__dma_8c.html#ac35b45a86a3d585e723b7a2f0bc8b9a2">EmacPsDmaIntrExample()</a>, <a class="el" href="xemacps__example__intr__dma_8c.html#afa31ff7ff7de0863dde3919fa1602671">EmacPsDmaSingleFrameIntrExample()</a>, and <a class="el" href="xemacps__example__intr__dma_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a0bc7c575f2858a89f9496f83dc6052d4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void EmacPsUtilFrameHdrFormatMAC </td>
          <td>(</td>
          <td class="paramtype">EthernetFrame *&#160;</td>
          <td class="paramname"><em>FramePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>DestAddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the MAC addresses in the frame. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">FramePtr</td><td>is the pointer to the frame. </td></tr>
    <tr><td class="paramname">DestAddr</td><td>is the Destination MAC address.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>Referenced by <a class="el" href="xemacps__example__intr__dma_8c.html#afa31ff7ff7de0863dde3919fa1602671">EmacPsDmaSingleFrameIntrExample()</a>.</p>

</div>
</div>
<a class="anchor" id="a6fddc02339ce2adea5260e2401572eb8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void EmacPsUtilFrameHdrFormatType </td>
          <td>(</td>
          <td class="paramtype">EthernetFrame *&#160;</td>
          <td class="paramname"><em>FramePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>FrameType</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the frame type for the specified frame. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">FramePtr</td><td>is the pointer to the frame. </td></tr>
    <tr><td class="paramname">FrameType</td><td>is the Type to set in frame.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>Referenced by <a class="el" href="xemacps__example__intr__dma_8c.html#afa31ff7ff7de0863dde3919fa1602671">EmacPsDmaSingleFrameIntrExample()</a>.</p>

</div>
</div>
<a class="anchor" id="af60ff561f93957fc82d6625103a3ec5c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void EmacPsUtilFrameMemClear </td>
          <td>(</td>
          <td class="paramtype">EthernetFrame *&#160;</td>
          <td class="paramname"><em>FramePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sets all bytes of a frame to 0. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">FramePtr</td><td>is a pointer to the frame itself.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>Referenced by <a class="el" href="xemacps__example__intr__dma_8c.html#afa31ff7ff7de0863dde3919fa1602671">EmacPsDmaSingleFrameIntrExample()</a>.</p>

</div>
</div>
<a class="anchor" id="a745c2dd310df9fc6a3067ec7c426d9b5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void EmacPsUtilFrameSetPayloadData </td>
          <td>(</td>
          <td class="paramtype">EthernetFrame *&#160;</td>
          <td class="paramname"><em>FramePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>PayloadSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function places a pattern in the payload section of a frame. </p>
<p>The pattern is a 8 bit incrementing series of numbers starting with 0. Once the pattern reaches 256, then the pattern changes to a 16 bit incrementing pattern: </p>
<pre>
  0, 1, 2, ... 254, 255, 00, 00, 00, 01, 00, 02, ...
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">FramePtr</td><td>is a pointer to the frame to change. </td></tr>
    <tr><td class="paramname">PayloadSize</td><td>is the number of bytes in the payload that will be set.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>Referenced by <a class="el" href="xemacps__example__intr__dma_8c.html#afa31ff7ff7de0863dde3919fa1602671">EmacPsDmaSingleFrameIntrExample()</a>.</p>

</div>
</div>
<a class="anchor" id="a9bf345bfd8b6008fd32c436c1c8f049e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LONG EmacPsUtilFrameVerify </td>
          <td>(</td>
          <td class="paramtype">EthernetFrame *&#160;</td>
          <td class="paramname"><em>CheckFrame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">EthernetFrame *&#160;</td>
          <td class="paramname"><em>ActualFrame</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function verifies the frame data against a CheckFrame. </p>
<p>Validation occurs by comparing the ActualFrame to the header of the CheckFrame. If the headers match, then the payload of ActualFrame is verified for the same pattern Util_FrameSetPayloadData() generates.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CheckFrame</td><td>is a pointer to a frame containing the 14 byte header that should be present in the ActualFrame parameter. </td></tr>
    <tr><td class="paramname">ActualFrame</td><td>is a pointer to a frame to validate.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful, else XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>Referenced by <a class="el" href="xemacps__example__intr__dma_8c.html#afa31ff7ff7de0863dde3919fa1602671">EmacPsDmaSingleFrameIntrExample()</a>.</p>

</div>
</div>
<a class="anchor" id="a115c0926c08893ef3e71c68f7622576a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void EmacPsUtilstrncpy </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>Destination</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>Source</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>n</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function copies data from source to desitnation for n bytes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Destination</td><td>is the targeted string to copy to. </td></tr>
    <tr><td class="paramname">Source</td><td>is the source string to copy from. </td></tr>
    <tr><td class="paramname">n</td><td>is number of bytes to be copied.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>This function is similar to strncpy(), however strncpy will stop either at null byte or n bytes is been copied. This function will copy n bytes without checking the content. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
